﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Site.Master" AutoEventWireup="true" CodeBehind="WFVisualizaFeedback.aspx.cs" Inherits="s2b.ControleDesenvolvimentoProjetos.WFVisualizaFeedback" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="DSFEEDBACK" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CS_DB_Controle_Projeto %>" DeleteCommand="DELETE FROM FEEDBACK
WHERE ID_FEEDBACK = @ID_FEEDBACK" InsertCommand="INSERT INTO FEEDBACK (ID_TAREFA, ID_FUNC, DESC_FEEDBACK)
VALUES
 (@ID_TAREFA, @ID_FUNC, @DESC_FEEDBACK)" 
        SelectCommand="SELECT FEED.ID_FEEDBACK AS [Id feedback], F.NOME_FUNC AS Colaborador, T.NOME_TAREFA AS Tarefa, FEED.DESC_FEEDBACK AS Feedback FROM FEEDBACK AS FEED INNER JOIN FUNCIONARIO AS F ON FEED.ID_FUNC = F.ID_FUNC INNER JOIN TAREFAS AS T ON FEED.ID_TAREFA = T.ID_TAREFA" 
        UpdateCommand="UPDATE FEEDBACK SET ID_TAREFA = @ID_TAREFA, ID_FUNC = @ID_FUNC, DESC_FEEDBACK = @DEC_FEEDBACK WHERE (ID_FEEDBACK = @ID_FEEDBACK)">
        <DeleteParameters>
            <asp:Parameter Name="ID_FEEDBACK" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID_TAREFA" />
            <asp:Parameter Name="ID_FUNC" />
            <asp:Parameter Name="DESC_FEEDBACK" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ID_TAREFA" />
            <asp:Parameter Name="ID_FUNC" />
            <asp:Parameter Name="DEC_FEEDBACK" />
            <asp:Parameter Name="ID_FEEDBACK" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" Width="100%" 
        AutoGenerateColumns="False" DataKeyNames="Id feedback" 
        DataSourceID="DSFEEDBACK" BackColor="White" BorderColor="#999999" 
        BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" 
        GridLines="Vertical">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:BoundField DataField="Id feedback" HeaderText="Id feedback" 
                InsertVisible="False" ReadOnly="True" SortExpression="Id feedback" />
            <asp:BoundField DataField="Colaborador" HeaderText="Colaborador" 
                SortExpression="Colaborador" />
            <asp:BoundField DataField="Tarefa" HeaderText="Tarefa" 
                SortExpression="Tarefa" />
            <asp:BoundField DataField="Feedback" HeaderText="Feedback" 
                SortExpression="Feedback" />
                <asp:ButtonField ButtonType="Image" CommandName="Delete" ImageUrl="~/Util/Imagens/delete.png"
                Text="Remover"></asp:ButtonField>
                <asp:ButtonField ButtonType="Image" CommandName="Edit"  ImageUrl="~/Util/Imagens/edit.png"
                Text="Editar"></asp:ButtonField>
                <asp:ButtonField ButtonType="Image" CommandName="View"  ImageUrl="~/Util/Imagens/view.png"
                Text="Visualizar"></asp:ButtonField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="#000040" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="#000040" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
</asp:Content>
